
import math

# 角度转弧度
o_deg = 30
o_rad = math.radians(o_deg)
print(f"30度 弧度制为 {o_rad}")

# sin(x), cos(x), tan(x)
print("sin(30度)=",math.sin(o_rad))
print("cos(30度)=",math.cos(o_rad))
print("tan(30度)=",math.tan(o_rad))

o_deg = 45
o_rad = math.radians(o_deg)
print("sin(45度)=",math.sin(o_rad))
print("cos(45度)=",math.cos(o_rad))
print("tan(45度)=",math.tan(o_rad))


# 反三角函数
sin_val = math.sin(o_rad)
asin_val = math.asin(sin_val)
print("反三角函数 反正弦asin(sin(45度))=%f 角度=%f"%(asin_val,math.degrees(asin_val)))
a=1
b=1
c=2

print("反三角函数 角度制 asin=%f acos=%f atan=%f"%(
    math.degrees(math.asin(a/c)),
    math.degrees(math.acos(b/c)),
    math.degrees(math.atan(a/b))
    ))

print("反三角函数 幅度值 asin=%f acos=%f atan=%f"%(
    math.asin(a/c),
    math.acos(b/c),
    math.atan(a/b)
    ))
